/**
 * Created by guodong on 2018/2/5.
 */
'use strict';
angular.module('app')
    .controller('statisticsController', [ '$rootScope', '$scope', '$http', '$state','$timeout',
        function($rootScope, $scope, $http, $state, $timeout) {
            $scope.title = '慧驿站平台用户统计';
            $scope.searchParams = { };
            $scope.loading = false;
            $scope.param={};
            $scope.search = function () {
                $scope.loading = true;
                $.ajax({
                    url : $scope.app.project_name+'/userCenter/user/userPlatCount',
                    data: $scope.searchParams
                }).then(function(result) {
                    console.log(result);
                    $scope.loading = false;
                    if (result.httpCode == 200) {
                        $scope.platformCountBeanList = result.data;
                        // $scope.records = result.data;
                        // $scope.platformCountBeanList = result.platformCountBeanList;
                    } else {
                        $scope.msg = result.msg;
                    }
                    $scope.$apply();
                });
            }
            $scope.search();

            $scope.search1 = function () {
                $scope.loading = true;
                $.ajax({
                    url : $scope.app.project_name+'/userCenter/user/userCsCount',
                    data: $scope.searchParams
                }).then(function(result) {
                    console.log(result);
                    $scope.loading = false;
                    if (result.httpCode == 200) {
                        $scope.CourierStationCountBeanList = result.data;
                        // $scope.records = result.data;
                        // $scope.platformCountBeanList = result.platformCountBeanList;
                    } else {
                        $scope.msg = result.msg;
                    }
                    $scope.$apply();
                });
            }
            $scope.search1();

            $scope.search2 = function () {
                $scope.loading = true;
                $.ajax({
                    url : $scope.app.project_name+'/userCenter/user/userFpCount',
                    data: $scope.searchParams
                }).then(function(result) {
                    console.log(result);
                    $scope.loading = false;
                    if (result.httpCode == 200) {
                        $scope.firePostCountBeanList = result.data;
                        // $scope.records = result.data;
                        // $scope.platformCountBeanList = result.platformCountBeanList;
                    } else {
                        $scope.msg = result.msg;
                    }
                    $scope.$apply();
                });
            }
            $scope.search2();

        } ]);
